package com.weberror.frontendmonitoring.pagedwelltime.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 页面停留时间(Pagedwelltime)表实体类
 *
 * @author cnxym
 * @since 2022-08-16 13:25:43
 */
@TableName("pagedwelltime")
public class Pagedwelltime{
    //停留时间id
    @TableId(value = "pagedwelltime_id", type = IdType.AUTO)
    private Integer pagedwelltimeId;
    //停留页面名字
    @TableField(value = "pagedwelltime_page")
    private String pagedwelltimePage;
    //停留时长上报类型
    @TableField(value = "pagedwelltime_type")
    private String pagedwelltimeType;
    //页面停留时长
    @TableField(value = "pagedwelltime_pagestoptime")
    private Long pagedwelltimePagestoptime;
    //页面凌晨停留时间
    @TableField(value = "pagedwelltime_time")
    private String pagedwelltimeTime;

    public Integer getPagedwelltimeId() {
        return pagedwelltimeId;
    }

    public void setPagedwelltimeId(Integer pagedwelltimeId) {
        this.pagedwelltimeId = pagedwelltimeId;
    }

    public String getPagedwelltimePage() {
        return pagedwelltimePage;
    }

    public void setPagedwelltimePage(String pagedwelltimePage) {
        this.pagedwelltimePage = pagedwelltimePage;
    }

    public String getPagedwelltimeType() {
        return pagedwelltimeType;
    }

    public void setPagedwelltimeType(String pagedwelltimeType) {
        this.pagedwelltimeType = pagedwelltimeType;
    }

    public Long getPagedwelltimePagestoptime() {
        return pagedwelltimePagestoptime;
    }

    public void setPagedwelltimePagestoptime(Long pagedwelltimePagestoptime) {
        this.pagedwelltimePagestoptime = pagedwelltimePagestoptime;
    }

    public String getPagedwelltimeTime() {
        return pagedwelltimeTime;
    }

    public void setPagedwelltimeTime(Object pagedwelltimeTime) {
        if (pagedwelltimeTime instanceof Date) {
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Date date = (Date) pagedwelltimeTime;
            this.pagedwelltimeTime = dateFormat.format(date);
        } else if (pagedwelltimeTime instanceof Long) {
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Date date = new Date((Long) pagedwelltimeTime);
            this.pagedwelltimeTime = dateFormat.format(date);
        }
    }
}

